package designpatterns.observer;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2022/2/10 8:39
 */
public class AppTest {

    private static final Logger logger = LoggerFactory.getLogger(AppTest.class);

    @Test
    public void test() {
        Subject subject = new Subject();

        new ObserverOne(subject);
        new ObserverTwo(subject);

        logger.info("第一次状态改变：12");
        subject.setState(12);

        logger.info("第二次状态改变：8");
        subject.setState(8);
    }

}
